<div class="album wp-20 channel-manage" ui-view="container">
    <div ng-if="!noPermission">
        <div class="head_title">
            <span class="tit-color">一级频道</span>
        </div>

        <div class="panel specific-search">
            <div class="searchWapper">
                <div class="form-group searchLump">
                    <div class="searchTitle">操作：</div>
                    <button type="button" class="btn-primary btn btn-select" ng-click="create()">
                        新建
                    </button>
                    <button type="button" class="btn-primary btn btn-select" ng-click="enableAll()">
                        启用
                    </button>
                    <button type="button" class="btn-primary btn btn-select" ng-click="disableAll()">
                        禁用
                    </button>
                    <!--<button type="button" class="btn-primary btn btn-select" ng-click="delete()">-->
                        <!--删除-->
                    <!--</button>-->
                </div>
            </div>
        </div>

        <div class="table-responsive">
            <table class="table table-bordered table-hover table-page">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" id="allCheck" ng-checked="" class="magic-checkbox" ng-model="checkData.allChecked"
                                ng-change="selectAllChange(checkData.allChecked)">
                        <label for="allCheck" ></label>
                    </th>
                    <th>频道_ID</th>
                    <th>频道名称</th>
                    <th>二级频道数量</th>
                    <th>专辑数</th>
                    <th>节目数</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in categoriesList">
                    <td>
                        <input type="checkbox" id="{{$index}}" class="magic-checkbox" ng-model="item.checked"
                               ng-change="selectOneChange(item.checked)">
                        <label for="{{$index}}" ></label>
                    </td>
                    <td>{{item.categoryId}}</td>
                    <td>{{item.categoryName}}</td>
                    <td>{{item.channelNum}}</td>
                    <td>{{item.albumNum}}</td>
                    <td>{{item.programNum}}</td>
                    <td>{{table[item.status]}}</td>
                    <td>
                        <a href="javascript:void(0);" ng-click="edit(item)" class="time-out">
                            编辑
                        </a>
                        <a ng-if="item.status==4" ng-click="disable(item)" class="time-out">禁用</a>
                        <a ng-if="item.status==2" ng-click="enable(item)" class="time-out">启用</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div class="panel-footer paging">
        <s-pagination conf="paginationConf"></s-pagination>
    </div>
    </div>
    <div ng-if="noPermission" ng-include="'templates/no-permission.html'"></div>

</div>

<script type="text/ng-template" id="oneLevelModel.html">
    <div class="modal-header ng-scope">
        <button type="button" class="close" ng-click="cancel()"><span>×</span></button>
        <span class="modal-title ng-binding">频道管理</span>
    </div>
    <form class="w5c-form demo-form"  w5c-form-validate name="oneLevel">
    <div class="modal-body ng-scope">
        <div class="control-group text-align-left channel-manage form-group" style="margin-bottom: 0px">
            <label class="control-label form-require w-109">频道名称：</label>
            <div class="controls modal-input">
                <input type="text" placeholder="频道名称" ng-model="formData.categoryName" name="LevelName" required
                       pattern="^[\u4e00-\u9fa5]{2,6}$">
            </div><br>
            <span ng-if="nameCheck" class="cl cr w5c-error" style="margin-left: 112px;display: inline-block;margin-top: -10px">
                <i class="fa fa-times error" aria-hidden="true"></i>{{message}}
            </span>
        </div>
        <div class="control-group text-align-left">
            <label class="control-label form-require w-109">频道状态：</label>
            <div class="controls modal-input">
                <label class="radio-inline iw-110" ng-repeat="item in initData.status">
                    <input type="radio" name="status" value="{{item}}" class="magic-radio" id="{{item}}" ng-model="formData.status">
                    <label for="{{item}}" style="top: -1px;margin: 0 10px 0 -18px;"></label>
                    {{table[item]}}
                </label>
            </div>
        </div>
    </div>
    <div class="modal-footer ng-scope">
        <button class="btn btn-primary ng-binding" type="button" ng-if="!formData.categoryId" w5c-form-submit="okCreate()">确定</button>
        <button class="btn btn-primary ng-binding" type="button" ng-if="formData.categoryId" w5c-form-submit="okEdit()">确定</button>
        <button class="btn ims-btn ng-binding" style="" type="button" ng-click="cancel()">取消</button>
    </div>
    </form>
</script>